#@layoutT("用户管理")
#define main()
	#@formStart()
		#@queryStart('操作用户')
		   <input type="search" name="userCode" autocomplete="off" class="layui-input" placeholder="操作用户"/>
		#@queryEnd()
		#@queryStart('时间')
			<input type="search" name="createTime" autocomplete="off" class="layui-input layui-date" placeholder="时间"/>
		#@queryEnd()		
		#@queryStart('资源类型')
		   <input type="search" name="methodName" autocomplete="off" class="layui-input" placeholder="资源类型"/>
		#@queryEnd()
		#@queryStart('日志类型')					
			#@getSelect('logType','remark','日志类型')			
		#@queryEnd() 
	#@formEnd()	
	
	#if(vs.code=='superadmin')
	<div class='layui-row f-index-toolbar'>
		<div class='layui-col-xs12'>
			<div class="layui-btn-group">		
				<button id='deleteBtn_' class="layui-btn  layui-btn-normal layui-btn-sm">
				  <i class="layui-icon">&#xe640;</i> 删除
				</button>			
			</div>
		</div>
	</div>	
	#end
	
	<div class="layui-row  f-index-toolbar">
			<div class="layui-col-xs12">
   				<table id="maingrid" lay-filter="maingrid"></table>
   			</div>
   	</div>
   	
   	<!-- 	每行的操作按钮 -->
	<script type="text/html" id="bar_maingrid">
  		<a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
	</script>
#end

#define js()
<!-- 分页表格 -->
<script>
	var userCode="#(vs.code)";
	gridArgs.title='系统日志';
	gridArgs.dataId='id';
	gridArgs.detailUrl='#(path)/portal/core/sysLog/detail/';
	gridArgs.deleteUrl='#(path)/portal/core/sysLog/delete';
	gridArgs.gridDivId ='maingrid';
	if(userCode!="superadmin"){
		gridArgs.heightDiff=55;
	}
	initGrid({id : 'maingrid'
			,elem : '#maingrid'
			,cellMinWidth: 80
			,cols : [ [
					{title: '主键',field : 'id',width : 35,checkbox : true},						
					{title: '序号',type:'numbers',width:35},
        			{title: '操作用户', field: 'user_code'},
	        		{title: '操作时间', field: 'create_time',templet:''},
	        		{title: '资源类型', field: 'method_name'},
					{title: '资源路径', field: 'url' },
        			{title: '资源数据', field: 'data'},
        			{title: 'ip地址', field: 'ip'},																	
        			{title: '日志类型', field: 'remark'},																	
					{title: '操作 ',fixed:'right',align : 'left',toolbar : '#bar_maingrid'} // 这里的toolbar值是模板元素的选择器
			] ]
			,url:"#(path)/portal/core/sysLog/list"
			,searchForm : 'searchForm'
		});
	
</script>

#end
#define layuiFunc()
	form.on('select(remark)',function(data){
		var value=data.value;
		console.log("字典函数下拉选择值：",value)
	})
#end
